function formatUrls(input) {
  // 使用正则表达式匹配所有的 URL
  const urlPattern = /(https?:\/\/[^\s]+)/g;
  // 匹配到的 URL 加上双引号
  const quotedUrls = input.match(urlPattern).map(url => `"${url}"`);
  // 将结果以逗号分隔
  return quotedUrls.join(",");
}

// 示例输入
let input = `
https://img.picgo.net/2024/12/13/_20230613145243_W2xEX_9xf65e8dbc09249bac.md.jpg
https://img.picgo.net/2024/12/13/b6c7c0de9be924cf7d336bf2197b9fad050313f213f46a5e.md.png
https://img.picgo.net/2024/12/13/Desktop-Screenshot-2023.05.28---11.30.50.92_3467x1950cf0192a55f3212be.md.png
https://img.picgo.net/2024/12/13/wallhaven-l35jjp1d86f28df7211acc.md.jpg
https://img.picgo.net/2024/12/13/00016-4100275246b07b6bbe0aac3d99.md.png
https://img.picgo.net/2024/12/13/2024-03-23-1453571203a81b2d7cdf45.md.jpg
https://img.picgo.net/2024/12/13/bg362a22c7cdfb2e51.md.png
https://img.picgo.net/2024/12/13/13345706815664189411d4ddb7a9667b5.md.jpg
https://img.picgo.net/2024/12/13/2024-03-23-145355772764a89b769e24.md.jpg
https://img.picgo.net/2024/12/13/2024-03-11-191103e231a1e3b3b33750.md.jpg
https://img.picgo.net/2024/12/13/1-5261e850f08f7d3386.md.jpg
https://img.picgo.net/2024/12/13/BEZ-IMENI-5b38ebd356e6a6b73.md.png
https://img.picgo.net/2024/12/13/88810d8fef45d233d5f.md.jpg
https://img.picgo.net/2024/12/13/139-161002120130fcdc8dac9ec0ae37.md.png
https://img.picgo.net/2024/12/13/1c56743909323fb46fa2a58446ca073cb7df5bf6b006153.md.jpg
https://img.picgo.net/2024/12/11/0-9152f7a24a4b18b14.md.jpg
https://img.picgo.net/2024/12/11/2023-09-06-1411161d3d571841dd1d125.md.jpg
https://img.picgo.net/2024/12/11/IMG_202409078385_3840x216161d68434ad705204.md.png
https://img.picgo.net/2024/12/11/2023-09-07-173305217d23c7e7546f46f7.md.jpg
https://img.picgo.net/2024/12/11/X-21f0e22975053ae00a.md.png
https://img.picgo.net/2024/12/11/QQ2023071601210266dfb069db635bd2.md.jpg
https://img.picgo.net/2024/12/10/625941b003cb28a52.md.png
https://img.picgo.net/2024/12/10/_0000018e80d72342935ec7.md.png
https://img.picgo.net/2024/12/10/eef463f8-6ac8-11ef-9dc3-329037ae0fb9_00003_raw48769bdb83ba1f3e.md.png
https://img.picgo.net/2024/12/10/IMG_04682eb88af7cb2e4682.md.png
https://img.picgo.net/2024/12/10/1b839417ef1c31090.md.png
https://img.picgo.net/2024/12/10/0a611c4f6b31b014f6f4d3f1112a6ce4-1-132adf496dc3ffc5a.md.jpg
https://img.picgo.net/2024/12/10/113Studio-Display-PC9e160a663f21d67a.md.png
`;

// 使用函数
const output = formatUrls(input);
console.log(output);
